<html>
<head>
	<meta charset="utf-8">
	<title>无标题文档</title>
	<link href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" rel="stylesheet" type="text/css">
	<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
	<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js" type="text/javascript"></script>
</head>
<body>
<div data-role="page" id="page">
	<div data-role="header">
		<h1>标题</h1>
	</div>
	<div data-role="content">
		<ul data-role="listview" data-inset="true">
			<li data-role="list-divider">
				注册
			</li>
			<li>
				<div data-role="fieldcontain">
					<label for="username">用户名:</label>
					<input type="text" name="textinput" id="username" value="张三"  />
				</div>
			</li>
			<li>
				<div data-role="fieldcontain">
					<label for="password">密码:</label>
					<input type="password" name="textinput" id="password" value="zhangsan"  />
				</div>
			</li>
			<li>
				<div data-role="fieldcontain">
					<fieldset data-role="controlgroup" data-type="horizontal">
						<legend>性别:</legend>
						<input type="radio" name="radio1" id="man" value="0" />
						<label for="man">男</label>
						<input type="radio" name="radio1" id="woman" value="1" />
						<label for="woman">女</label>
					</fieldset>
				</div>
			</li>
			<li>
				<div data-role="fieldcontain">
					<fieldset data-role="controlgroup" data-type="horizontal">
						<legend>爱好</legend>
						<input type="checkbox" name="checkbox1" id="football" class="custom" value="0" />
						<label for="football">足球</label>
						<input type="checkbox" name="checkbox1" id="basketball" class="custom" value="1" />
						<label for="basketball">篮球</label>
						<input type="checkbox" name="checkbox1" id="vollyball" class="custom" value="2" />
						<label for="vollyball">排球</label>
					</fieldset>
				</div>
			</li>
			<li>
				<div data-role="fieldcontain">
					<label for="selectmenu" class="select">国籍:</label>
					<select name="selectmenu" id="selectmenu">
						<option value="China">中国</option>
						<option value="America">美国</option>
						<option value="Japan">日本</option>
					</select>
				</div>
			</li>
			<li>
				<button id="commit">提交</button>
			</li>
		</ul>
	</div>
	<div data-role="footer" data-position="fixed">
		<h4>脚注</h4>
	</div>
	
	<!-- 测试没成功，从assets中直接载入脚本  -->
	<script>
	    $(function() {
	        $("#commit").click(function() {
	            var result = "{";
	            result += "\"username\":\"";
	            result += $("#username").val();

	            result += "\",\"password\":\"";
	            result += $("#password").val();

	            result += "\",\"gender\":\"";
	            result += $('input[name="radio1"]:checked').val();
	            
	            result += "\",\"interest\":\"";
	            $('input[name="checkbox1"]:checked').each(function() {
	                result += $(this).val() + ",";
	            });
	            
	            result += "\",\"country\":\"";
	            result += $("#selectmenu option:selected").text() + "\"}";
	            register_js.call(result);
	            });
	        });

	    function setUserName(username) {
		    $("#username").val(username);
		}
		
		function sum2Java(number1, number2) {
			return number1 + number2;
		}
		
	</script>
</div>
</body>
</html>